class DashboardController < ApplicationController
  before_filter :require_user

  def index
    @messages = []
    @messages = Message.find(:all, :conditions => {:user_id => current_user.user_id}, :order => "timestamp DESC")
    @modules = UserModule.find(:all, :conditions => {:user_id => current_user.user_id})
#    @modules.each do |mod|
#      @inputs << (Input.find_by_input_id(mod.input_id)) unless (Input.find_by_input_id(mod.input_id)).nil?
#      @outputs << (Output.find_by_output_id(mod.output_id)) unless (Output.find_by_output_id(mod.output_id)).nil?
#    end
  end

  def list_modules
    @user_module = UserModule.new
    @inputs = Input.all
    @outputs = Output.all
  end

end
